# 类装饰器
class CountCalls:
    def __init__(self,func):
        self.func = func
        self.count = 0

    def __call__(self, *args, **kwargs):
        self.count += 1
        print(f"{self.func.__name__}函数被调用了{self.count}次")
        return self.func(*args,**kwargs)

@CountCalls
def say_hello():
    print("hello")

say_hello()
say_hello()